package com.boot.common;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2016080800193255";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDcYGkNEG4VCG6NmlaHD0hCxO4nCW8gq5nV0YhQDO+M+ayDR0ARkYdHhGQPUzZPnBRMdDtaw6sgbZaC1Na4MMG8y4dTCP9w+QYZBcD7zbr+19mCt8ncO76F3zB7q7sDmlzSHAigcdUHLxzRmxVM2zQ5FiNv1LY4LDAfbTERYhNag/p3/WleW85kUxgOt1aVAo35Jw83mtb1hFyVQaK4mUq5IWHkYZgKzJf9tpO3SXcyIJkocHJ8QQRpsckz00kclA4KKCYObAdXpbGWjUyUEAugKohWINMyPst70u30giGmh4I1UR3Ch/HZz9ugDWSZ2T+XQwLKT7SEdUn0TpMp3MwdAgMBAAECggEBANUjCXbxJQaCmSmq03Tceu7Yt9xZa3kVfjsl48hIOocGEqsFBhn3vfaVPJD10dk9AwTOhXlLNP6v/pmab/DEdxu5XLAaS7NfpV4eCn9+ghRnfp7GUh0GS0X+jk2N0dmyOYOcSVujvHyuPBkc/ITQnLl5h9xoxbOeSQyb9pDxYfZvUrS244ojr6IbrxQh6rbhdrH6dUYfk4wd27yFsAYf8AaxoqjxhkKipU3zQbNANm2NOKIDChEmMe1FBUKaMqtEnQLLRRu3Bi3nx+cYCqC4tfvjr/8wgkSZfIfYd+/hWVmTZk/zCeHY5XGyUtmep0GekLql262abCt/XXaEenFpawECgYEA+CfKQl3bHdSbELYb3ynT5yeyBR8m+9BERPPX6Sp7mGcUsXK8o74jbVNNgDZsuGF++mP2okxBRQBVKhB7PzdkhI6olh4hoGRGrNE7fda8knvHeQcNn9QjSZMmg2PhfLTZnHlBqVyby3N3znuddi88tVnp4jTPXMZSXh7yu4Z289UCgYEA41fRmrxcp+Dvb/ADOMOyjg3Xfno0vvSVlnlPLdv8U6eiej97FRxR5RkCO1EIx0obHeoSLOczh6D5KH5dvIVKILuJnIL/h6lrZxC70CA3brgrsgPzLLDfgFpCPkPiOwyTPcS/H0VwTgjvDfdsBKUzOp7WDGAp3xHOv0j98VWDQykCgYEAnnAxN+xawRIEK0hKRVKcY8K5a4G3TyFq5SdW3BzuqqBt2tnpzRXR4rREEC8vfQ1qmA2I45iSN679sQyy0+rW97dptebpC1Haue4g8LhQz6nN8tzo+vnjyc700QDNb+S756aXoL1rDxvbC29rWpDQTu1oYa/cEVziLAvQaKByhD0CgYBW/0knlINEfvBBfrBM7Z6Le8KGFM/Qbxo7PerN2swBWzny3A4GsxKnv905w7W/RZ2A4gzYgBUZBsGx/EF0nfES+5Eagoq0aGHATAgDCgEMbo/SDG7nIDw3CtMkrqeI/zPtRDf7CICEbCjGyHLeiDVFbnjsvXPoeBEM5CrBSn7zmQKBgH20JmDbchEd/HLHJ5BXUaOfK0bS4w4F1bJ42zPDPualx+iXV1cDjVKEkmwKCyS8jQACJMmOK3+an6D4FUi34Qk1F042TtRo6U6jWXm+J8cHcd0ppIk+ojkMwN+Of1DuzAV7QRFg840GtkQIyzky5zbRgt2bY0R0GD+Hn8plsYSi";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4DQxBxnQaBQKrVzGoTkQNsEFbAw/vrq/mlVZtyyLQwyYE9uSQrrXUbr6646WQNUa7R/nfuGzNyQOWwduPgYLD58hhG3cKKv1DrXYsJ1wD+PxijCPM6UhwRffzU/JcBXR54QjHg4QSNhZfw+4OBzrFMtTBtOrRv5K0ACqxm294GDhXAub95sP3K1qhylPlElQm5GeuZrOtkgyVGIDXpOiuEYq/JIVCsAlI0wiIOR2Mhhvoif6bREemNryU7bLJZP3LvFEDP2gMTOrnUmELKz67SxVmr7PEjCBojSr7snOjVhCsMpfPkKRQ/vP9z6FnOf9hWwCbdq04YIGd343MDOfvwIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	//public static String notify_url = "http://selljun.nat100.top/api/ali_pay//notify";
    public static String notify_url = "http://www.dragonjun.com/ssm/pay/ali_notify";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://www.dragonjun.com/boot/pay/notify";
    //public static String return_url = "http://localhost:8080/pay/notify";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

